package com.colin.springbootsource.event;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author: Colin
 * 2019/12/22 14:48
 * @desc 监听器触发类,外部无须自己实现,只要调用就好
 * @email zhaod@oceansoft.com.cn,colinzhaodong@gmail.com
 */
@Component
public class WeatherRunListener {
    @Autowired
    private WeatherEventMulticaster weatherEventMulticaster;

    public void snow(){
        weatherEventMulticaster.multicastEvent(new SnowEvent());
    }

    public void rain(){
        weatherEventMulticaster.multicastEvent(new RainEvent());
    }
}
